//导入自定义验证规则的包
const joi = require('@hapi/joi')

const name = joi.string().required()
const alias = joi.string().alphanum().required() //alphanum 只能包含数字与字母
const id = joi.number().required().integer().min(1)
//定义验证注册和登录表单数据的规则对象
exports.add_cate_schema = {
    body: {
        name,
        alias
    }
}

//删除文章的id验证
exports.deleteId_schema = {
    params: {
        id
    }
}

exports.update_schema = {
    body: {
        name,
        alias,
        id
    }
}

